import React from 'react';
import LifeCpt from './compontent/LifeCpt';

class App extends React.Component{
  constructor(props){
    super(props);
    this.state={
      count:0,
      name:'coco',
      age:18,
      show:false
    }
  }
  addAge(){
    this.setState({
      age:this.state.age+1
    })
  }
  render(){
    return(
      <div style={{border:'5px solid pink',width:'300px',height:'300px'}}>
          <LifeCpt name={this.state.name} age={this.state.age} />
          <button onClick={e=>this.addAge()}>年龄</button>
      </div>
    )
  }
}

export default App;
